#pragma once
#define SFML_DYNAMIC
#include <SFML/Graphics.hpp>
#include <string>
#include <iostream>
#include <vector>
#include "Tile.h"
#include "BaseOBJ.h"
#include "Player.h"
#include "Value.h"
#include "Definition.h"
#include "Factory.h"
#include "ScriptManager.h"

#define VERSION 0.09

//Special id's for entitys:
//id 0 is the player


class Game
{
    public:
        void init(std::string title, int x, int y);
        void update();
        void draw();


        void addtile(Def def);
        void addtile(Tile t, int x, int y);

        void addent(Def def);
        void addent(BaseOBJ* obj);


        void SetPlayer(Player play) {user = play;};
        bool run() {return running;};

        Player& GetPlayer() {return user;};

        //Tile* BuildTileArrayFromPoint(int x, int y);

        static Game& Instance() {return m_Game;};
    private:
        sf::RenderWindow win;
        sf::View v;
        Tile tiles[100][100];
        std::vector<BaseOBJ*> ents;
        Player user;
        bool running;
        bool paused;
        static Game m_Game;
    protected:
        Game() {}; //Singleton
};
